package org.kfive.nova.design.structture.proxy;

/**
 * Created by admin on 2017-03-01.
 * 远程代理-为远程对象提供本地代理
 * 虚拟代理-延迟加载
 * 保护代理-控制Subject的访问权限、保护Subject内部数据
 */
public class ProxySubjcet implements Subject {

    private Subject concreteSubject;

    public ProxySubjcet(Subject concreteSubject) {
        this.concreteSubject = concreteSubject;
    }

    public void request() {
        doFilter();
        concreteSubject.request();
    }

    private void doFilter(){
        System.out.println("判断对象是否允许访问");
    }
}
